<template>
  <su-popup
    :show="show"
    type="bottom"
    round="20"
    @close="emits('close')"
    showClose
    backgroundColor="#000"
  >
    <view class="model-box">
      <view class="header">
        <view class="title">实时挂售 (101份)</view>
        <view class="time">市场交易时间为：00:00~15:00 15:00~23:59</view>
      </view>
      <view class="search-box ss-flex ss-row-between ss-col-center">
        <view class="search-box-l ss-flex ss-row-center ss-col-center">
          <view>价格</view>
          <view class="arrow-container">
            <view class="arrow down" :class="{ 'selected-down': priceSort===1 }" @tap="priceSort=1"></view>
            <view class="arrow up" :class="{ 'selected-up': priceSort===2 }" @tap="priceSort=2"></view>
          </view>
        </view>
        <view class="search-box-r">多选</view>
      </view>
      <view class="list">
        <view class="item">
          <view class="item-t ss-flex ss-row-between ss-col-center">
            <view class="item-t-l">汽车减震器</view>
            <view class="item-t-r" @tap="onConfirm">去购买 ></view>
          </view>
          <view class="item-b ss-flex ss-row-between ss-col-center">
            <view class="item-b-l">1605713/1650000</view>
            <view class="item-b-r">￥2435.00</view>
          </view>
        </view>
        <view class="item">
          <view class="item-t ss-flex ss-row-between ss-col-center">
            <view class="item-t-l">汽车减震器</view>
            <view class="item-t-r" @tap="onConfirm">去购买 ></view>
          </view>
          <view class="item-b ss-flex ss-row-between ss-col-center">
            <view class="item-b-l">1605713/1650000</view>
            <view class="item-b-r">￥2435.00</view>
          </view>
        </view>
        <view class="item">
          <view class="item-t ss-flex ss-row-between ss-col-center">
            <view class="item-t-l">汽车减震器</view>
            <view class="item-t-r" @tap="onConfirm">去购买 ></view>
          </view>
          <view class="item-b ss-flex ss-row-between ss-col-center">
            <view class="item-b-l">1605713/1650000</view>
            <view class="item-b-r">￥2435.00</view>
          </view>
        </view>
      </view>
    </view>

  </su-popup>
</template>
<script setup>
  import { computed, reactive, ref, unref } from 'vue';
  import { code } from '@/sheep/validate/form';

  const props = defineProps({
    modelValue: {
      type: Object,
      default() {
      },
    },
    show: {
      type: Boolean,
      default: false,
    },
  });
  const emits = defineEmits(['confirm', 'close']);
  const priceSort = ref(0);


  const onConfirm = async () => {
    console.log(123);
    emits('confirm', 1);
  };
</script>
<style lang="scss" scoped>
  .arrow {
    cursor: pointer;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    margin: 0 4px;
  }

  .up {
    border-top: 4px solid #3b3b3b;
  }

  .down {
    border-bottom: 4px solid #3b3b3b;
    margin-bottom: 2px;
  }

  .selected-up {
    border-top: 4px solid #00a1ff !important;
  }

  .selected-down {
    border-bottom: 4px solid #00a1ff !important;
  }

  .search-box {
    padding: 17px 15px;
    box-sizing: border-box;

    .search-box-l {
      width: 67px;
      height: 24px;
      line-height: 24px;
      background: #1E1E1E;
      border-radius: 12px;
      font-weight: 300;
      font-size: 14px;
      color: #FFFFFF;

      .arrow-container {
        margin-left: 3px;
      }
    }

    .search-box-r {
      width: 60px;
      height: 24px;
      line-height: 24px;
      border-radius: 12px;
      text-align: center;
      font-weight: 300;
      font-size: 14px;
      color: #FFFFFF;
      border: 1px solid #FFFFFF;
    }
  }

  .list {
    padding: 0 15px;
    box-sizing: border-box;

    .item {
      width: 100%;
      background: #1E1E1E;
      border-radius: 10px;
      padding: 18px;
      box-sizing: border-box;
      margin-bottom: 10px;

      .item-t {
        margin-bottom: 17px;

        .item-t-l {
          font-weight: 400;
          font-size: 15px;
          color: #FFFFFF;
          line-height: 15px;
        }

        .item-t-r {
          font-weight: 300;
          font-size: 12px;
          color: #00A1FF;
          line-height: 12px;
        }
      }

      .item-b {
        .item-b-l {
          font-weight: 400;
          font-size: 12px;
          color: #DEDEDE;
          line-height: 12px;
        }

        .item-b-r {
          font-weight: 400;
          font-size: 14px;
          line-height: 14px;
          color: #FFFFFF;
        }
      }
    }
  }

  :deep() {
    .uni-checkbox-input {
      background-color: var(--ui-BG-Main);
    }

    .uni-forms-item {
      padding: 0 15px;
      box-sizing: border-box;
      height: 50px;
      background: #1E1E1E;
      border-radius: 10px;
      width: 345px;
      margin: 10px auto 0;

      .ss-reset-button {
        color: #00A1FF;
      }
    }

    .uni-forms-item__label {
      .label-text {

        font-weight: 400;
        font-size: 15px;
        color: #FFFFFF
      }

      height: 100%;
    }

    .uni-forms-item__box, .uni-forms-item__inner, .uni-easyinput, .uni-easyinput__content {
      height: 100%;
    }

    .uni-forms-item__inner {
      padding-bottom: 5px;
    }

    .uni-input-input {
      color: #fff;
    }
  }

  .model-box {
  }

  .header {
    padding: 26px 18px 17px;
    box-sizing: border-box;

    .title {
      font-weight: 400;
      font-size: 20px;
      margin-bottom: 17px;
      color: #FFFFFF;
    }

    .time {
      font-weight: 300;
      font-size: 13px;
      line-height: 13px;
      color: #DDDDDD;
    }

    border-bottom: 1px solid #353535;
  }

  .number {
    font-weight: 500;
    font-size: 36px;
    line-height: 36px;
    color: #F5F6F8;
    padding: 27px 0;
    text-align: center;
  }

  .form {
    width: 345px;
    background: #1E1E1E;
    border-radius: 10px;
    box-sizing: border-box;
    margin: 0 auto;

    .balance {
      padding: 18px 15px;
      box-sizing: border-box;

      &:first-child {
        border-bottom: 1px solid #353535;
      }

      .balance-l {
        .balance-1 {
          width: 15px;
          height: 15px;
          margin-right: 8px;
        }

        font-weight: 400;
        font-size: 15px;
        color: #FFFFFF;
      }

      .balance-r {
        font-weight: 400;
        font-size: 15px;
        color: #FFFFFF;
      }
    }


  }

  .subtitle {
    font-size: 26rpx;
    font-weight: 500;
    color: #333333;
  }

  .model-content {
    height: 54vh;
  }

  .modal-footer {
    width: 100%;
    padding: 16px 15px;
    box-sizing: border-box;
  }

  .confirm-btn {
    width: 100%;
    height: 50px;
    line-height: 50px;
    font-weight: 500;
    font-size: 16px;
    color: #090909;
    background: linear-gradient(90deg, #45C9F0, #36F6AF);
    border-radius: 25px;
  }

</style>
